#ifndef _RawImage_H_
#define _RawImage_H_

#pragma once
#include "Image.h"

class RawImage : public Image {
private:
	unique_ptr<Color[]> colorBuffer;
	ToneMapping toneMapping;

public:
	RawImage(int width, int height);
	RawImage(string filename, float gamma = 2.2, float scale = 1.0);
	~RawImage() {}

	void setColor(int x, int y, const Color &color);
	void addColor(int x, int y, const Color &color);
	void clearColor(int x, int y);
	Color getColor(int x, int y) const;
	void getColor(Color & color, int x, int y) const;
	Color getOutputColor(int x, int y) const;
	void getOutputColor(Color & color, int x, int y) const;

	void setToneMapping(ToneMapping & toneMapping) {
		this->toneMapping = toneMapping;
		this->toneMapping.setAdaptedLum(getAverageLuminance());
		std::cout << getAverageLuminance() << std::endl;
	}
};

#endif // _RawImage_H_